package com.gsj.system.utils;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * @program: clms-nine
 * @description: 获取时间
 * @author: 郭书江
 * @create: 2021-07-24 19:33
 **/
public class SystemTimeUtil {

    public static String getTime(){
        Date now = new Date();
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        String nowTime = df.format(now);
        return nowTime;
    }
    public static String getTimeLong(){
        Date now = new Date();
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
        String longTime1 = df.format(now);
        String longTime='M'+longTime1;
        return longTime;
    }

    public static void main(String[] args) {
        String time = SystemTimeUtil.getTimeLong();
        System.out.println(time);

    }
}
